{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/containers/DialogInput.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { DialogInput as DialogInputComponent } from \"../components\";\nimport { Context } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport mime from \"mime\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  _s();\n  let {\n    chat\n  } = _ref;\n  window.navigator.getUserMedia = window.navigator.getUserMedia || window.navigator.mozGetUserMedia || window.navigator.msGetUserMedia || window.navigator.webkitGetUserMedia;\n  const {\n    store\n  } = React.useContext(Context);\n  const [value, setValue] = React.useState(false);\n  const [emojiPickerVisible, setEmojiPickerVisible] = React.useState(false);\n  const [flagForStyle, setFlagForStyle] = React.useState(false);\n  const [isRecording, setIsRecording] = React.useState(false);\n  const [isShortInput, setIsShortInput] = React.useState(false);\n  const [cursorPosition, setCursorPosition] = React.useState(0);\n  const [textField, setTextField] = React.useState('');\n  const [mediaRecorder, setMediaRecorder] = React.useState(null);\n  const [uploaded, setUploaded] = React.useState();\n  const [images, setImages] = React.useState();\n  const [voice, setVoice] = React.useState();\n  const pickerRef = React.useRef(null);\n  const textAreaRef = React.useRef(null);\n  const maxSizeMessage = 500;\n  React.useEffect(() => {\n    var _textAreaRef$current;\n    let dialogListInput = {\n      items: store.getDialogInput().items ? [...store.getDialogInput().items] : []\n    };\n    (_textAreaRef$current = textAreaRef.current) === null || _textAreaRef$current === void 0 ? void 0 : _textAreaRef$current.focus();\n    if (textField.length > maxSizeMessage * 0.05) {\n      setFlagForStyle(true);\n    } else {\n      setFlagForStyle(false);\n    }\n    dialogListInput.items[chat.id] = {\n      inputText: textField\n    };\n    store.setDialogInput({\n      ...store.getDialogInput(),\n      ...dialogListInput\n    });\n  }, [textField]);\n  React.useEffect(() => {\n    var _uploaded$items;\n    if (textField.length > 0 || (uploaded === null || uploaded === void 0 ? void 0 : (_uploaded$items = uploaded.items) === null || _uploaded$items === void 0 ? void 0 : _uploaded$items.length) > 0) {\n      setValue(true);\n    } else {\n      setValue(false);\n    }\n  }, [textField, uploaded]);\n  React.useEffect(() => {\n    if (emojiPickerVisible) {\n      const handleClick = e => {\n        var _pickerRef$current;\n        if (!pickerRef.current) return;\n        if (!((_pickerRef$current = pickerRef.current) !== null && _pickerRef$current !== void 0 && _pickerRef$current.contains(e.target))) {\n          var _textAreaRef$current2;\n          (_textAreaRef$current2 = textAreaRef.current) === null || _textAreaRef$current2 === void 0 ? void 0 : _textAreaRef$current2.focus();\n          setEmojiPickerVisible(false);\n        }\n      };\n      document.addEventListener('click', handleClick);\n      return () => {\n        document.removeEventListener('click', handleClick);\n      };\n    }\n  }, [emojiPickerVisible]);\n  React.useEffect(() => {\n    var _textAreaRef$current3;\n    if ((_textAreaRef$current3 = textAreaRef.current) !== null && _textAreaRef$current3 !== void 0 && _textAreaRef$current3.selectionEnd) {\n      textAreaRef.current.selectionEnd = cursorPosition;\n    }\n  }, [cursorPosition]);\n  React.useEffect(() => {\n    if (store.getDialogInput().items && store.getDialogInput().items[chat.id]) {\n      setTextField([...store.getDialogInput().items][chat.id].inputText);\n    } else {\n      setTextField('');\n    }\n    setCursorPosition(0);\n    setIsShortInput(false);\n  }, [chat]);\n  React.useEffect(() => {\n    var _tempUploaded$items;\n    setUploaded({\n      items: []\n    });\n    const tempUploaded = {\n      ...store.getUploadedContentForChats()\n    };\n    if ((tempUploaded === null || tempUploaded === void 0 ? void 0 : (_tempUploaded$items = tempUploaded.items) === null || _tempUploaded$items === void 0 ? void 0 : _tempUploaded$items.length) > 0 && tempUploaded.items[chat.id]) {\n      setUploaded({\n        items: tempUploaded.items[chat.id].uploadedContent.items\n      });\n    }\n  }, [chat, store.uploadedContentForChats]);\n  React.useEffect(() => {\n    var _uploaded$items2;\n    let tempImagesList = {\n      items: []\n    };\n    setVoice({});\n    if (uploaded !== null && uploaded !== void 0 && (_uploaded$items2 = uploaded.items) !== null && _uploaded$items2 !== void 0 && _uploaded$items2.length) {\n      uploaded.items.forEach((item, index) => {\n        var _mime$getType, _mime$getType2;\n        if ((_mime$getType = mime.getType(item.link)) !== null && _mime$getType !== void 0 && _mime$getType.includes('image')) {\n          tempImagesList.items[index] = item;\n        } else if ((_mime$getType2 = mime.getType(item.link)) !== null && _mime$getType2 !== void 0 && _mime$getType2.includes('webm')) {\n          setVoice(item);\n          setIsShortInput(true);\n          console.log(voice);\n        }\n      });\n    }\n    setImages({\n      ...images,\n      ...tempImagesList\n    });\n  }, [uploaded]);\n  const onRecord = () => {\n    navigator.mediaDevices.getUserMedia({\n      audio: true\n    }).then(stream => onRecording(stream)).catch(err => onError(err));\n  };\n  const onRecording = stream => {\n    const recorder = new MediaRecorder(stream);\n    setMediaRecorder(recorder);\n    recorder.start();\n    recorder.onstart = () => {\n      setIsRecording(true);\n      setIsShortInput(true);\n    };\n    recorder.onstop = () => {\n      setIsRecording(false);\n    };\n    recorder.ondataavailable = e => {\n      const file = new File([e.data], 'audio.webm');\n      store.uploadFiles([file]);\n    };\n  };\n  const onStopRecording = () => {\n    setIsRecording(false);\n    mediaRecorder === null || mediaRecorder === void 0 ? void 0 : mediaRecorder.stop();\n  };\n  const onError = err => {\n    console.log('The following error occured: ' + err);\n  };\n  const toggleEmojiPicker = () => {\n    var _textAreaRef$current4;\n    (_textAreaRef$current4 = textAreaRef.current) === null || _textAreaRef$current4 === void 0 ? void 0 : _textAreaRef$current4.focus();\n    setEmojiPickerVisible(!emojiPickerVisible);\n  };\n  const addEmoji = identifier => {\n    const ref = textAreaRef.current;\n    ref === null || ref === void 0 ? void 0 : ref.focus();\n    const start = textField.substring(0, ref === null || ref === void 0 ? void 0 : ref.selectionStart) || '';\n    const end = textField.substring((ref === null || ref === void 0 ? void 0 : ref.selectionStart) || 500) || '';\n    setTextField(start + identifier + end);\n    setCursorPosition(start.length + identifier.length);\n  };\n  const uploadDocumentHandler = React.useCallback(e => {\n    let collectionFiles = [];\n    if (e.target.files) {\n      [...e.target.files].forEach(item => {\n        const file = item;\n        collectionFiles.push(file);\n      });\n      store.uploadFiles(collectionFiles);\n    }\n    e.target.value = '';\n  }, [store]);\n  const handleSendMessage = () => {\n    if (textField.length - 1 <= maxSizeMessage) {\n      setTextField('');\n      setIsShortInput(false);\n    }\n  };\n  const handleDeleteContent = contentId => {\n    store.deleteUploadedContent(chat.id, contentId);\n    setIsShortInput(false);\n  };\n  return /*#__PURE__*/_jsxDEV(DialogInputComponent, {\n    toggleEmojiPicker: toggleEmojiPicker,\n    emojiPickerVisible: emojiPickerVisible,\n    setEmojiPickerVisible: setEmojiPickerVisible,\n    value: value,\n    textField: textField,\n    setTextField: setTextField,\n    maxSizeMessage: maxSizeMessage,\n    uploadDocumentHandler: uploadDocumentHandler,\n    handleSendMessage: handleSendMessage,\n    pickerRef: pickerRef,\n    addEmoji: addEmoji,\n    flagForStyle: flagForStyle,\n    textAreaRef: textAreaRef,\n    images: images || {\n      items: []\n    },\n    voice: voice,\n    callbackOnDeleteContent: handleDeleteContent,\n    onRecord: onRecord,\n    onStopRecording: onStopRecording,\n    isRecording: isRecording,\n    isShortInput: isShortInput\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 220,\n    columnNumber: 9\n  }, this);\n};\n_s(DialogInput, \"Iy2LXjjdbIcJdVw8B6EvKaSqIDI=\");\n_c = DialogInput;\nexport default _c2 = observer(DialogInput);\nvar _c, _c2;\n$RefreshReg$(_c, \"DialogInput\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","DialogInput","DialogInputComponent","Context","observer","mime","chat","window","navigator","getUserMedia","mozGetUserMedia","msGetUserMedia","webkitGetUserMedia","store","useContext","value","setValue","useState","emojiPickerVisible","setEmojiPickerVisible","flagForStyle","setFlagForStyle","isRecording","setIsRecording","isShortInput","setIsShortInput","cursorPosition","setCursorPosition","textField","setTextField","mediaRecorder","setMediaRecorder","uploaded","setUploaded","images","setImages","voice","setVoice","pickerRef","useRef","textAreaRef","maxSizeMessage","useEffect","dialogListInput","items","getDialogInput","current","focus","length","id","inputText","setDialogInput","handleClick","e","contains","target","document","addEventListener","removeEventListener","selectionEnd","tempUploaded","getUploadedContentForChats","uploadedContent","uploadedContentForChats","tempImagesList","forEach","item","index","getType","link","includes","console","log","onRecord","mediaDevices","audio","then","stream","onRecording","catch","err","onError","recorder","MediaRecorder","start","onstart","onstop","ondataavailable","file","File","data","uploadFiles","onStopRecording","stop","toggleEmojiPicker","addEmoji","identifier","ref","substring","selectionStart","end","uploadDocumentHandler","useCallback","collectionFiles","files","push","handleSendMessage","handleDeleteContent","contentId","deleteUploadedContent"],"sources":["/data/messenger.client/src/containers/DialogInput.tsx"],"sourcesContent":["import React from \"react\";\nimport {DialogInputContainerProps} from \"../models/props/DialogInputContainerProps\";\nimport {ContentListResponse} from \"../models/response/ContentListResponse\";\nimport {ContentListItem} from \"../models/response/ContentListItem\";\nimport {ShortChatList} from \"../models/uploadedStoreModel/ShortChatList\";\nimport {InputTextList} from \"../models/inputDialogModel/InputTextList\";\nimport {DialogInput as DialogInputComponent} from \"../components\";\nimport {Context} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\nimport mime from \"mime\";\n\nconst DialogInput: React.FC<DialogInputContainerProps> = ({chat}) => {\n\n    window.navigator.getUserMedia =\n        window.navigator.getUserMedia ||\n        window.navigator.mozGetUserMedia ||\n        window.navigator.msGetUserMedia ||\n        window.navigator.webkitGetUserMedia;\n\n    const {store} = React.useContext(Context);\n\n    const [value, setValue] = React.useState<boolean>(false);\n    const [emojiPickerVisible, setEmojiPickerVisible] = React.useState<boolean>(false);\n    const [flagForStyle, setFlagForStyle] = React.useState<boolean>(false);\n    const [isRecording, setIsRecording] = React.useState<boolean>(false);\n    const [isShortInput, setIsShortInput] = React.useState<boolean>(false);\n\n    const [cursorPosition, setCursorPosition] = React.useState<number>(0);\n    const [textField, setTextField] = React.useState<string>('');\n\n    const [mediaRecorder, setMediaRecorder] = React.useState<MediaRecorder | null>(null);\n\n    const [uploaded, setUploaded] = React.useState<ContentListResponse>();\n    const [images, setImages] = React.useState<ContentListResponse>();\n    const [voice, setVoice] = React.useState<ContentListItem>();\n\n    const pickerRef = React.useRef<null | HTMLDivElement>(null);\n    const textAreaRef = React.useRef<null | HTMLTextAreaElement>(null);\n\n    const maxSizeMessage: number = 500;\n\n    React.useEffect(() => {\n        let dialogListInput: InputTextList = {\n          items: store.getDialogInput().items?\n              [...store.getDialogInput().items]:\n              []\n        };\n        textAreaRef.current?.focus();\n\n        if (textField.length > maxSizeMessage * 0.05) {\n            setFlagForStyle(true);\n        } else {\n            setFlagForStyle(false);\n        }\n\n        dialogListInput.items[chat.id] = {\n            inputText: textField\n        };\n\n        store.setDialogInput({\n            ...store.getDialogInput(),\n            ...dialogListInput\n        });\n    }, [textField]);\n\n    React.useEffect(() => {\n        if (textField.length > 0 || uploaded?.items?.length! > 0) {\n            setValue(true);\n        } else {\n            setValue(false);\n        }\n    }, [textField, uploaded]);\n\n    React.useEffect(() => {\n        if (emojiPickerVisible) {\n            const handleClick = (e: any) => {\n                if (!pickerRef.current) return;\n                if (!pickerRef.current?.contains(e.target)) {\n                    textAreaRef.current?.focus();\n                    setEmojiPickerVisible(false);\n                }\n            }\n\n            document.addEventListener('click', handleClick);\n\n            return () => {\n                document.removeEventListener('click', handleClick)\n            }\n        }\n    }, [emojiPickerVisible]);\n\n    React.useEffect(() => {\n        if (textAreaRef.current?.selectionEnd!) {\n            textAreaRef.current.selectionEnd = cursorPosition;\n        }\n    }, [cursorPosition]);\n\n    React.useEffect(() => {\n        if (store.getDialogInput().items && store.getDialogInput().items[chat.id]) {\n            setTextField([...store.getDialogInput().items][chat.id].inputText);\n        } else {\n            setTextField('');\n        }\n        setCursorPosition(0);\n        setIsShortInput(false);\n    }, [chat]);\n\n    React.useEffect(() => {\n        setUploaded({items: []});\n        const tempUploaded: ShortChatList = {...store.getUploadedContentForChats()};\n\n        if (tempUploaded?.items?.length > 0 &&\n            tempUploaded.items[chat.id]\n        ) {\n            setUploaded({\n                items: tempUploaded.items[chat.id].uploadedContent.items\n            });\n        }\n    }, [chat, store.uploadedContentForChats]);\n\n    React.useEffect(() => {\n        let tempImagesList: ContentListResponse = {items: []};\n        setVoice({} as ContentListItem);\n\n        if (uploaded?.items?.length) {\n            uploaded.items.forEach((item, index) => {\n                if (mime.getType(item.link)?.includes('image')) {\n                    tempImagesList.items[index] = item;\n                } else if (mime.getType(item.link)?.includes('webm')) {\n                    setVoice(item);\n                    setIsShortInput(true);\n                    console.log(voice);\n                }\n            });\n        }\n\n        setImages({\n            ...images,\n            ...tempImagesList\n        });\n    }, [uploaded]);\n\n    const onRecord = () => {\n        navigator.mediaDevices.getUserMedia({audio: true}).\n        then(stream => onRecording(stream)).\n        catch(err => onError(err));\n    };\n\n    const onRecording = (stream: MediaStream) => {\n        const recorder = new MediaRecorder(stream);\n        setMediaRecorder(recorder);\n\n        recorder.start();\n\n        recorder.onstart = () => {\n            setIsRecording(true);\n            setIsShortInput(true);\n        };\n\n        recorder.onstop = () => {\n            setIsRecording(false);\n        };\n\n        recorder.ondataavailable = e => {\n            const file = new File([e.data], 'audio.webm');\n            store.uploadFiles([file]);\n        };\n    };\n\n    const onStopRecording = () => {\n        setIsRecording(false);\n        mediaRecorder?.stop();\n    }\n\n    const onError = (err: MediaStreamError) => {\n        console.log('The following error occured: ' + err);\n    };\n\n    const toggleEmojiPicker = () => {\n        textAreaRef.current?.focus();\n        setEmojiPickerVisible(!emojiPickerVisible);\n    }\n\n    const addEmoji = (identifier: string) => {\n        const ref = textAreaRef.current;\n        ref?.focus();\n\n        const start: string = textField.substring(0, ref?.selectionStart) || '';\n        const end: string = textField.substring(ref?.selectionStart || 500) || '';\n\n        setTextField(start + identifier + end);\n        setCursorPosition(start.length + identifier.length);\n    }\n\n    const uploadDocumentHandler = React.useCallback( (e: React.ChangeEvent<HTMLInputElement>) => {\n        let collectionFiles: File[] = [];\n        if (e.target.files) {\n            [...e.target.files].forEach((item) => {\n                const file: File = item;\n                collectionFiles.push(file);\n            });\n            store.uploadFiles(collectionFiles);\n        }\n        e.target.value = '';\n    }, [store]);\n\n    const handleSendMessage = () => {\n        if (textField.length - 1 <= maxSizeMessage) {\n            setTextField('');\n            setIsShortInput(false);\n        }\n    }\n\n    const handleDeleteContent = (contentId: string) => {\n        store.deleteUploadedContent(chat.id, contentId);\n        setIsShortInput(false);\n    }\n\n    return (\n        <DialogInputComponent\n            toggleEmojiPicker={toggleEmojiPicker}\n            emojiPickerVisible={emojiPickerVisible}\n            setEmojiPickerVisible={setEmojiPickerVisible}\n            value={value}\n            textField={textField}\n            setTextField={setTextField}\n            maxSizeMessage={maxSizeMessage}\n            uploadDocumentHandler={uploadDocumentHandler}\n            handleSendMessage={handleSendMessage}\n            pickerRef={pickerRef}\n            addEmoji={addEmoji}\n            flagForStyle={flagForStyle}\n            textAreaRef={textAreaRef}\n            images={images || {items: []}}\n            voice={voice}\n            callbackOnDeleteContent={handleDeleteContent}\n            onRecord={onRecord}\n            onStopRecording={onStopRecording}\n            isRecording={isRecording}\n            isShortInput={isShortInput}\n        />\n    );\n}\n\nexport default observer(DialogInput);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAMzB,SAAQC,WAAW,IAAIC,oBAAoB,QAAO,eAAe;AACjE,SAAQC,OAAO,QAAO,UAAU;AAChC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,OAAOC,IAAI,MAAM,MAAM;AAAC;AAExB,MAAMJ,WAAgD,GAAG,QAAY;EAAA;EAAA,IAAX;IAACK;EAAI,CAAC;EAE5DC,MAAM,CAACC,SAAS,CAACC,YAAY,GACzBF,MAAM,CAACC,SAAS,CAACC,YAAY,IAC7BF,MAAM,CAACC,SAAS,CAACE,eAAe,IAChCH,MAAM,CAACC,SAAS,CAACG,cAAc,IAC/BJ,MAAM,CAACC,SAAS,CAACI,kBAAkB;EAEvC,MAAM;IAACC;EAAK,CAAC,GAAGb,KAAK,CAACc,UAAU,CAACX,OAAO,CAAC;EAEzC,MAAM,CAACY,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